package com.shujia.day17;

public class Student {

    public String name;
    private int age;

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Student(String name) {
        this.name = name;
    }

    private Student() {
    }


    public void printInfo(){
        System.out.println("这是一个学生的成员方法..");
    }

    private void learn(boolean flag){
        if (flag){
            System.out.println("受打击了...");
            System.out.println(this.name+"我爱学习。。我爱学习....");
        }else {
            System.out.println("我想躺一下，Java太简单了..");
        }

    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
